package com.breadenglish.cms.api.app.gateway.model;

import com.breadenglish.cms.api.app.gateway.util.CustomDateSerializer;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.jsondoc.core.annotation.ApiObject;
import org.jsondoc.core.annotation.ApiObjectField;

import java.util.Date;

/**
 * Created by jk on 16/1/5.
 */
@ApiObject
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
public class CourseStatistics {
    @ApiObjectField(description = "用户ID(学生数据库中的唯一ID")
    private String userId;

    @ApiObjectField(description = "用户头像url")
    private String photo;

    @ApiObjectField(description = "用户姓名")
    private String name;

    @ApiObjectField(description = "昵称")
    private String nickname;

    @ApiObjectField(description = "累计上课,单位节")
    private int grandTotalClass;

    @ApiObjectField(description = "总课时,单位节")
    private int totalClass;

    @ApiObjectField(description = "累计说英语,单位小时")
    private float grandTotalHours;

    @ApiObjectField(description = "BE VIP有效期")
    @JsonSerialize(using = CustomDateSerializer.class)
    private Date validDate;

    public static CourseStatistics build(String userId, String photo, String name, String nickname, int grandTotalClass, int totalClass, float grandTotalHours, Date validDate) {
        CourseStatistics courseStatistics = new CourseStatistics();
        courseStatistics.userId = userId;
        courseStatistics.photo = photo;
        courseStatistics.name = name;
        courseStatistics.nickname = nickname;
        courseStatistics.grandTotalClass = grandTotalClass;
        courseStatistics.totalClass = totalClass;
        courseStatistics.grandTotalHours = grandTotalHours;
        courseStatistics.validDate = validDate;
        return courseStatistics;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getGrandTotalClass() {
        return grandTotalClass;
    }

    public void setGrandTotalClass(int grandTotalClass) {
        this.grandTotalClass = grandTotalClass;
    }

    public int getTotalClass() {
        return totalClass;
    }

    public void setTotalClass(int totalClass) {
        this.totalClass = totalClass;
    }

    public float getGrandTotalHours() {
        return grandTotalHours;
    }

    public void setGrandTotalHours(float grandTotalHours) {
        this.grandTotalHours = grandTotalHours;
    }

    public Date getValidDate() {
        return validDate;
    }

    public void setValidDate(Date validDate) {
        this.validDate = validDate;
    }
}
